#include "cpu/exec/template-start.h"

#define instr test

static void do_execute() {
    DATA_TYPE ret = op_dest -> val & op_src -> val; //按位与比较目标操作数与源操作数

    cpu.eflags.SF = ret >> ((DATA_BYTE << 3) - 1); //设置SF
    cpu.eflags.ZF = !ret; //设置ZF
    cpu.eflags.CF = 0; //设置CF
    cpu.eflags.OF = 0; //设置0F

    ret ^= ret >> 4;
    ret ^= ret >> 2;
    ret ^= ret >> 1;
    ret &= 1; 

    cpu.eflags.PF = !ret; //设置PF

    DATA_TYPE result = op_dest -> val & op_src -> val;
    update_eflags_pf_zf_sf((DATA_TYPE_S)result);
    cpu.eflags.CF = cpu.eflags.OF = 0;

    print_asm_template1();
}

make_instr_helper(i2a)
make_instr_helper(i2rm)
make_instr_helper(r2rm)
#include "cpu/exec/template-end.h"